//
//  ICEEMGetDeviceInfo.m
//  EasyMoney
//
//  Created by 邓乐 on 2020/1/9.
//  Copyright © 2020 zh. All rights reserved.
//

#import "ICEEMGetDeviceInfo.h"
#import "ICEJavaScriptBridge.h"
#import "WDPDeviceInfoManager.h"
#import <AdSupport/AdSupport.h>

@implementation ICEEMGetDeviceInfo

-(void)getDeviceInfo:(NSDictionary*)args
{
    NSString* uuidString = [NSString deviceUUID];
     NSString *idfaStr = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
    NSString* wifimac = SAFE_STRING([[WDPDeviceInfoManager sharedManager] getWifiMac]);
    NSString* platform = [NSString stringWithFormat:@"%@",[UIDevice currentDevice].systemVersion];
    NSString* model = [NSString stringWithFormat:@"%@", [WDPDeviceInfoManager deviceHardInfo]];
    NSNumber* isRoot = [NSNumber numberWithBool:[UIDevice currentDevice].isJailbroken];
    NSString *size = NSStringFromCGSize(YYScreenSize());
    NSDictionary* ret = @{@"status":@"success",@"uuid":uuidString,@"wifimac":wifimac,@"idfa":idfaStr,@"platform":platform,@"model":model,@"isRoot":isRoot,@"size":size};
    [ICEJavaScriptBridge sendReslutToJS:ret callInfo:args];
}

@end
